/**
 * webpack 联邦模块配置
 */
const { ModuleFederationPlugin } = require('webpack').container;

// 设置MF
export default function initMF(config) {
  // 打包
  config.plugin('mf').use(ModuleFederationPlugin, [
    {
      name: 'mf1',
      library: { type: 'umd', name: 'mf1' },
      filename: 'remoteEntry.js',
      exposes: {
        './Button': './src/pages/RemoteComp/Button/index',
        './Alert': './src/pages/RemoteComp/Alert/index',
      },
      shared: ['react'],
    },
  ]);
}
